<template>
    <div class="navigate"   >
        <el-menu  
          :default-active="activeIndex"
          class="el-menu-demo daohang"
          mode="horizontal"
          @select="handleSelect"
          background-color="ECFFEB"
          text-color="black"
          :ellipsis="false"
          active-text-color="#27A221"
        >
          <MenuLogoContent/>
         
            <MenuCardTip ref="actiontip" @open_dialogFormVisible="open_dialogFormVisible" @close_dialogFormVisible="close_dialogFormVisible"/>
                <svg t="1720675119252" class="icon zhuye"  viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="935">
                  <path d="M531.525857 431.455522c5.787856 14.947688 18.435983 28.776361 30.885908 30.886269 41.014596 6.950822 61.45392-58.174424 112.311701-47.731573-1.327212-8.815686 7.557954-7.418995 8.424338-14.040844-51.204817-4.098798-95.002078 10.14663-129.160377 30.886148h-22.46157zM893.730964 487.611553c-20.260508 3.561267-48.488259 11.795711-67.384949 19.656989-15.053532 6.259882-34.261013 17.591274-36.502414 30.886389 63.666301-5.239728 123.442361-48.557979 199.354001-42.118919-5.898036-15.386238-27.584255-7.788187-39.306994-8.424338-19.700941-1.064226-38.221214-3.148485-56.159644-0.000121z" p-id="936" fill="#1E8A22">
                  </path>
                  <path d="M806.692518 557.808308c69.831055 9.181386 125.489773 22.275168 182.504964 39.310486-34.711003-44.195714-123.577346-77.198754-196.545809-47.735185-13.272718-14.804755-44.188368-11.967543-47.731332-36.498681-5.371342-1.309029-12.088319 8.655053-11.232651-2.808072 0.877462-9.415472 12.720978-7.868624 22.46157-8.424699 6.365968 14.099366 26.827448 19.869401 44.927233 14.041084 5.268869-5.356651-1.667383-5.082467 0-14.041084 36.571532-18.022599 85.462217-29.065116 117.927846-44.92314 11.126686-5.437209 22.805595-11.697091 30.886269-19.657109-24.600738-2.248625-52.214374 9.660396-81.429527 14.040844-8.263464 1.23955-17.115876-1.133344-25.269642 0-31.822012 4.413442-51.654927 26.088824-75.809287 36.498801-13.631313-7.894392-32.337989-10.713543-44.926993-19.653617 5.364237-39.562755 24.695625-65.154386 47.735065-87.041939-24.187595 3.890481-29.383131 26.776272-53.347718 30.886028-15.876206 15.009822-13.616743 48.155674-30.886148 61.772297-41.186308 3.839305-89.217472-8.183147-115.120014 5.616385 11.408096 13.232741 26.22429 19.492623 36.498921 33.694221 1.798997 2.486324-1.539262 8.541501 0 11.228919 3.897826 6.797534 17.828852 3.875911 14.040724 14.040964-37.855153-0.05503-55.779133-33.427382-84.233746-33.694341-7.824793 24.385075 19.397375 51.676842-2.808193 67.388682 3.608951-27.010358-2.698375-44.100706-14.040723-56.155911-0.054909-10.351576 17.05013-3.547058 14.040723-16.849037-9.250985-0.694914-32.542333 2.449718-30.885907-16.845424 6.164755-5.067897 11.507076-10.954734 19.653256-14.040844 12.519885 10.881763 21.072224 25.726977 39.310727 30.886268-6.687716-15.774094-20.94037-23.982769-30.885907-36.502413 12.545293-11.993311-47.51603-51.940069-53.347959-19.653497 11.631345 4.277976 29.445386 2.376626 33.694221 14.040844-3.894334 6.402453-19.543799 1.045802-28.077956 2.80458-41.515522-66.116139-93.546745-121.720069-168.471465-154.427008-9.166695 4.870416-8.632776 19.441447-22.46169 19.653497 10.154096-25.412454 35.584733-35.544635 64.58049-42.1188 10.940043-7.777349 9.660516-27.77451 25.269883-30.882536 4.979994 5.312941 2.044041 18.541948 2.808192 28.078076 7.616475 12.150453 22.794155 15.686192 30.886269 28.077956 7.916067 12.124925 4.563238 28.648481 16.845184 39.306994 1.755166-55.102884-18.552786-88.14265-33.694221-126.349054 6.910845-2.449718 6.289023-12.435474 16.849158-11.232651-16.015406 59.746559 66.909432 43.032988 84.233866 78.617601 4.694852-10.574464-13.060909-12.786604-5.616506-16.845304 4.837663 2.650931 4.596232 10.376984 14.040844 8.424458-24.666605-35.237336-58.737363-61.066546-81.429527-98.27471 13.631434 0.526574 8.833989-17.37549 22.465303-16.845304 8.205063 2.087872 5.433596 15.155885 16.845304 14.037111 45.193832-9.543352 103.002315-12.044247 143.19809-14.037111-3.846891-5.514033-16.929595-1.788039-16.845425-11.232652 4.201512-0.47901 10.362534 1.00173 11.228919-2.808193-20.271586-5.923443-37.208044-16.593035-58.964104-19.653497-38.594018-5.433476-68.379335 14.004238-98.270977 16.845425 2.577719-11.536217 27.134385-15.814313 22.461569-25.269762-6.48277 3.809923-12.519524 8.069837-22.461569 8.424337 9.0753-31.419947-2.570494-51.903463-14.040844-70.196634-6.81945-10.874417-13.770152-28.520359-25.269883-25.269763 7.389855 19.273348-1.992624 51.768237-2.808193 70.196755-15.623937-11.543562-22.849064-46.37498-42.114826-44.926992 9.73722 2.526663 22.746712 16.432161 14.03687 28.077955-26.560248-14.911082-52.868588-34.370711-87.041938-33.694341 2.354711 7.941956 3.261434 17.33178 5.616265 25.269883 20.743251 14.099245 49.098883 28.129252 67.388682 47.735065 2.79001 2.990983 2.373014 9.876058 5.612653 14.037232 11.053594 14.205331 48.068012 20.549383 36.502173 44.926992-24.136178-28.641135-67.925853-11.353307-109.503508-14.040844-26.582524-1.714827-53.921856-10.72438-84.233866-8.420726-9.857755 0.745849-30.07082-0.899498-33.694221 11.228919 40.407465-2.972679 67.00468 7.868744 87.042059 25.269762 13.755582 2.819151 19.949838-3.488296 25.269883 5.616386-6.040487 11.854112-24.523793 20.468705-33.694221 25.269763-15.349994 8.040456-38.297678 19.792456-53.347718 22.461569-5.404335 0.961632-11.495998-1.202944-16.845545 0-33.328762 7.503165-32.940786 40.568459-53.347838 58.964104-6.212078 4.087841-18.69909 1.894124-22.465182 8.424579-6.365847 8.062612 5.203122 19.514538-8.420846 22.461569-4.570704-32.644806 17.163681-38.988858 19.653618-64.576756 12.52699-19.313566 40.327028-38.268658 42.115187-58.964104-18.991577 16.57112-29.822163 41.307204-53.347959 53.347838-17.894599-35.156779-27.035645-62.247574-50.539284-87.042059-19.112353-20.161888-37.054756-35.31404-58.964345-47.735185 17.74119 32.696103 46.627249 75.089207 70.196755 106.699289 16.870953 22.626056 33.343332 37.431173 19.653618 56.155911-18.871162-19.503581-54.141251-22.604141-89.850373-25.269763v44.92338c13.360741 9.104561 26.465481 18.46127 33.694462 33.694221-10.351576 5.557864-22.655558 9.166695-33.694462 14.040844v25.269762c31.851393-0.92888 55.080968-25.386926 87.0423-16.849037-18.98086 9.097216-46.777286 9.378986-64.58061 19.65711-8.329812 18.812039-27.438553 26.845269-22.462051 58.963742 25.354053-13.02069 47.793707-28.951805 67.388562-47.735065 21.949686-5.305595 33.920962 11.653019 53.347838 16.848917-6.720589 8.252747-17.719154 12.23089-19.653617 25.269763 22.962736 4.24161 21.9828-15.455959 36.498801-19.65711 8.73549 4.36937 23.500267 2.709453 28.077956 11.232651-15.192371 22.242294-34.224407 40.648776-44.92314 67.388562-29.047053 21.492592-43.237573 57.841356-70.196875 81.425553 7.733518-26.893315 24.860593-69.944245 5.616386-98.27459 13.971365-15.975067 19.788843-40.111365 28.077955-61.772296-16.172426 10.0332-14.658692 37.756654-28.077955 50.543257-7.751701 1.199331-2.636241-10.468499-8.424579-11.232651-6.950822 28.867756 14.483489 46.005668 11.233013 73.004828-2.994836 24.860232-29.504148 42.616233-25.269883 70.193142 1.162605 7.587214 12.629463 6.77899 5.616145 19.656989-10.680429 4.124808-0.552102-12.552518-11.232651-8.424579-5.184819 6.604028-13.667799 9.898215-8.424459 19.653738 10.720768 2.043559 21.046696-12.421025 25.273375 0C25.317928 658.08672 0.699008 667.16202 0.848924 701.006158c12.227157-7.576016 17.554668-21.660811 28.077956-30.885908 7.349395-6.442672 19.704794-5.985818 22.461569-16.845424 9.945538-1.521079 6.903499 9.941805 16.849037 8.424578 2.662009-5.76269 3.48083-13.364354 11.229039-14.040964 23.360948-6.588856 40.699832-19.200015 56.155911-33.694221-29.434548 4.25606-48.213954 19.170634-75.809167 25.269883 4.892211-0.83026 9.846677 10.892479 0 8.424338-9.192584-13.971244 11.912513-21.704763 19.653376-28.077835 3.923354-12.925803 11.846646-21.847454 16.848917-33.694221-10.936551-5.05718-9.843185 16.007819-16.848917 5.616145 10.899945-31.189834 33.28469-53.23802 53.35121-75.809167 20.359128-22.907827 34.03078-51.753667 58.964224-70.196875 16.78305 11.58366 41.270477 14.987906 64.576757 22.461569 12.516152 4.011377 24.637103 22.406901 33.694221 11.232651-31.123727-14.739129-53.472106-38.250114-84.233866-53.347718 12.238235-9.667741 13.69706-26.611785 30.886028-30.886027 19.690103-4.899798 42.791677 12.420904 61.772055 5.612532-17.923859-7.345783-35.62471-14.914574-47.734944-28.077955 8.698884-10.018629 17.697359-19.741279 25.273495-30.886149 3.316343 4.172011 2.427803 12.545293 11.229039 11.232772 18.99543-23.990115 58.262086 1.063865 73.004827 11.232531 0.983668-9.755523-14.278422-10.662126-5.616265-19.65711 39.888236 36.860648 99.042595 54.452042 112.311821 117.928328-12.728082 1.495431-29.635641 7.612742-53.347838 5.616145-15.272928-14.676875-16.50152-43.398568-28.077835-61.772176-2.182999 25.584286 3.87567 42.919558 2.808314 67.388562-64.649969 16.779558-121.07296 41.782361-157.238935 87.042179 14.552607-7.740743 30.911556-2.299922 44.926872-2.808072 31.906423-1.159233 64.763159-21.705004 98.270978-28.077955 37.625041-7.152156 64.565558-11.071897 89.850372-22.461931 7.861399-3.542843 18.805055-19.177979 28.077955-8.424218-4.431625 13.803025-20.973484 10.790007-30.886389 16.849037-20.040992 12.248952-33.076252 33.141758-56.155911 50.539525-31.873309 24.0266-48.820725 37.281377-58.963862 70.193263 40.078492 14.589093 68.459892-11.408216 89.84989-30.886389 25.529618-23.247758 50.002234-58.448488 73.005189-75.809167 10.095334 14.344049-6.168488 22.743099-14.040844 28.077955-27.518508 46.418691-6.844978 141.033394-33.694462 188.125204 28.736143-25.540455 33.45291-75.593745 44.927113-117.928569 4.994684-18.428638 11.616654-42.005128 28.077835-50.543138-6.51191 17.441237-15.071835 47.81189-19.653497 61.772297-15.408274 46.919255-7.426099 94.673104 30.882536 117.927967 2.486324 11.269257 12.600202 20.183683 16.849037 30.886148 13.031648 32.838915 17.042423 71.410777 30.886148 103.891216 4.709301-81.283343 30.871458-190.724597 0-263.93449 11.704436 1.407769 12.384419-8.208675 25.269642-5.616266 21.712228 19.679145-15.686071 59.143401 5.616266 75.809288 13.335214-43.753189 41.873755-72.310034 84.233866-87.041818 31.299291 25.792242-3.948762 118.132792 28.077835 143.197729-0.679862 12.018839-4.182728 45.819025 5.616506 56.15579 8.285861-19.166901 15.240175-36.732406 19.653497-61.768323 5.03129-28.549861 9.15947-92.647367 28.078076-101.083023 32.070909 25.021347 35.73477 78.452994 53.347718 117.928448 1.700136-5.788338-4.530124-19.507554 5.616145-16.845425 1.203064 18.450554 1.963965 37.34327 11.233012 47.731091-2.179628-78.357505-17.156095-168.123828-64.58061-210.58617-4.63621 0.04347-1.572015 7.788187-5.616265 8.424338 0.489968-8.165085-9.86498-19.836166-2.808073-25.269883 16.395675 4.669324 29.554963 25.949865 44.927113 22.46169-7.188762-21.82891-39.058458-18.969662-47.735305-39.310607 7.916188 2.501135 17.587541 17.818135 25.269882 11.232651-3.049504-0.673119-6.739013-4.625733-2.8047-5.616506zM444.483798 150.675968c1.301322 8.790158-2.442614 12.534335-11.232892 11.232651-1.301684-8.790158 2.442493-12.534214 11.232892-11.232651z m-14.041085-5.616386c-5.082346-11.762717-14.804876-18.889225-16.845304-33.694221 9.419325 6.332854 24.494653 19.368234 16.845304 33.694221zM40.159531 310.722855c16.297056-7.80661 40.890208 0.237699 53.347838 5.612653-0.573897 8.786305 1.894124 20.615129-2.808072 25.269762-26.001403-1.140689-29.734501-24.549441-50.539766-30.882415z m39.306994 42.115187h14.040724c2.742446 11.309355-16.779437 11.309355-14.040724 0z m322.898353-146.006163c-6.738772 12.918217-18.172395 21.134358-28.077955 30.886148-24.465392-7.356861-54.37883-9.261823-84.233866-11.232651 11.495878-36.279406 79.82801-3.773558 112.311821-19.653497z m-123.54074 98.27471c-2.252599 9.7371 4.179236 10.790007 2.804581 19.653497-20.31915-4.087961-7.488474-16.827001-8.420966-25.269762-10.69512-2.270661-8.618326 8.230591-16.849037 8.424338-1.330944 8.819419 3.502745 11.47035 8.424338 14.037231-2.756896 3.795474-7.492087 5.612653-11.232411 8.424338-1.517708 9.941925 9.945658 6.903379 8.424338 16.845425-16.870953 46.436994-123.573854-3.440732-151.622428 36.502414 9.448345 34.846109 66.789017 18.604082 89.850372 14.040844-2.289205 10.812163-11.591126 14.614861-16.845545 22.46169-25.56213-9.068196-61.384441-7.876089-81.425673-22.46169-2.950523-17.92398 7.70787-22.242174 11.229039-33.694342 27.880716-9.616444 46.363902-33.745517 78.621213-30.886148-15.086406-4.570704-33.595601-5.715006-53.351451-5.616265 32.037916-30.377878 83.425642-39.175381 117.928208-67.388562 9.386332-7.674876 16.607365-19.569448 25.269883-28.077956 28.139849 4.618147 48.978107 16.538126 81.429285 16.848797-0.131734 11.101158-6.183178 16.278632-8.424578 25.269882-28.864023 6.698794-50.872231 20.256775-75.809168 30.886269z m376.24559 233.048222c19.72683-10.223696 28.268331-31.628505 58.964465-30.886389-16.348352 11.378955-32.399762 47.856202-58.964465 30.886389z m81.425794 42.115067c-15.532542-4.950853-3.187981-20.926161 0-30.886269 6.984057-0.431446 8.691779 4.413442 14.037472 5.616627-4.724353 8.376774-11.123315 15.082673-14.037472 25.269642z" p-id="937" fill="#1E8A22"></path><path d="M79.466525 479.190587c0.617848-10.614683 8.826523-13.634926 11.232651-22.46157-8.409647 1.089633-16.20542 17.298786-11.232651 22.46157zM225.472688 1004.251134c-2.19769-12.797802-17.598739-34.516774-28.077956-44.927112-2.980145-2.961481-7.415503-0.266839-11.229279-2.808073-14.644122-9.748178-26.637313-29.993754-42.118439-42.115067-15.649706-12.256658-35.252027-14.790306-39.307235-30.885787 7.08653-12.567449 30.568012-8.739343 39.307235-19.653617-22.395944 1.926396 4.778901-13.331481-11.229279-19.65723 6.471933-6.74985 9.053505-4.281588 19.653617-2.808193-2.318346-11.718886-21.335571-6.742625-28.077955-14.037111 0.043951-4.63645 7.788427-1.572497 8.424338-5.616506-31.723151-13.108232-52.407881-7.499071-92.658204-14.037112 27.240711-13.071746 91.601805 6.728175 98.270977-30.886028-4.208496-3.276245-6.863281-8.109935-14.037111-8.424578-0.595812 3.148244-3.115371 4.369491-5.616265 5.616747-35.211808-2.439122-75.187706 14.651347-117.928328 14.03675v42.11904c11.002418 8.00397 28.429085 13.89454 39.310606 14.036991-7.733278 15.097363-20.867278 10.285348-33.69422 16.848917-0.870238-8.490205 3.118983-21.836376-5.616386-22.465303 1.846561 19.682878-3.707571 46.762595 2.808313 61.772176 8.724412-5.3127 15.591064-12.482797 28.078196-14.03687-3.217964 11.642182 5.90502 10.939923 5.616145 19.653256-7.938223 25.774662-48.550393 33.789469-33.694341 73.004828 11.985846-16.091989 26.871399-29.284632 42.118679-42.118439 6.530454-7.507139 0.852175-27.226262 14.037473-28.077955-5.788459 16.399047 7.824793 33.887968 0 50.539284 14.845094 9.441241 11.554279 35.782333 14.040603 50.543378 5.5103-27.244083 23.799859-41.716614 19.653497-78.621213-11.283827-21.470797-26.761581-38.751039-36.502534-61.772056 27.244204 12.065921 46.795468 31.822012 50.539645 67.388562 17.320461 29.650091 48.495605 38.941295 78.620973 56.15567 14.841723 8.483221 25.193179 19.679507 39.307235 22.461811-13.459722-6.11394 1.111669-4.768425 0-11.22916zM34.543386 877.898469c-0.201213-8.413741 8.259851-14.245429 14.03687-8.424338 1.287234 8.775347-5.996294 8.97656-14.03687 8.424338z" p-id="938" fill="#1E8A22">
                  </path>
                </svg>
              </el-menu>
            <el-dialog title="账号登录"  v-model="dialogFormVisible"   custom-class="zhuce"  style="width: 500px;height:350px;" top="20vh">
              <MenuCardContent @login_off_new="login_off_new" ref="open_card"/>
            </el-dialog>
            <el-dialog style="height: 550px;margin-top:50px;" v-model="dialogFormVisibleLogin"   width="500" title="账号注册">
              <el-form :model="form" >
                <el-form-item label="头像" :label-width="formLabelWidth">
                  <el-upload
                  :action="baseURL"
                  :on-success="handleAvatarSuccess"
                  :show-file-list="false"
                  >
                  <div v-if="card_open_photo" :class="card_open" class="photo_card" @mouseover="select_card('grow_photo')" @mouseout="select_card('close_photo')">
                    <img class="photo_card" v-if="close_photo==false" :src="end_crop_photo" alt="">
                    <img v-if="close_photo" class="photo_card" :src="end_crop_photo" alt="">
                  </div>
                  <div class="photo_card"  v-if="card_open_photo==false" >
                    <div class="photo_card_active" ></div>
                  </div>
                </el-upload>
                <div  style="margin-left: 5%;display:flex;" v-if="card_open_photo==false" >
                  <img  ref="photo_crop" :src="src_photo" style="width: 100px;height:100px;" alt="">
                  <div style="flex-direction: column;display:flex;margin-left:10px">
                    <el-button @click="crop_photo_end" style="width: 60px;">确定</el-button>
                  </div>
                </div>
              </el-form-item>
              <el-form-item label="用户名" :label-width="formLabelWidth">
                  <el-input placeholder="请输入用户名" style="width: 80%;" v-model="form.username"  />
                </el-form-item>
                <el-form-item :label-width="formLabelWidth" label="性别">
                  <el-select style="width: 80%;" v-model="form.gender" placeholder="选择性别">
                    <el-option label="男" value="男" />
                    <el-option label="女" value="女" />
                  </el-select>
                  <span style="color: red;margin-left:5px;margin-top:-5px;">*</span>
                  <span class="error_information"> {{ error_form.gender }} </span>
                </el-form-item>
                
                <el-form-item label="密码" :label-width="formLabelWidth">
                  <el-input placeholder="请输入密码" style="width: 80%;" v-model="form.password" />
                </el-form-item>
                <el-form-item  label="手机号" :label-width="formLabelWidth">
                  <el-input placeholder="请输入手机号" style="width: 80%;" v-model="form.phone"  />
                  <span style="color: red;margin-left:5px;margin-top:-5px;">*</span>
                  <span class="error_information"> {{ error_form.phone }} </span>
                </el-form-item>
                <el-form-item label="收货地址" :label-width="formLabelWidth">
                  <el-cascader
                  placeholder="选择收货地址"
                  :options="regionData"
                  style="width: 40%"
                  v-model="form.address">
                  </el-cascader>
                  <el-input placeholder="详细地址" style="width: 40%" v-model="form.detailed_address"  />
                </el-form-item>
              </el-form>
              <template #footer>
                <div style=" width:85%" class="dialog-footer">
                  <el-button  @click="close_dialog_card()">取消</el-button>
                  <el-button type="primary" @click="login_add()">
                    提交
                  </el-button>
                </div>
              </template>
            </el-dialog>
      </div>

</template>
<script setup lang="ts">
import 'cropperjs/dist/cropper.css'
import {pcaTextArr,regionData} from "element-china-area-data";
import MenuCardContent from './MenuCardContent.vue';
import MenuLogoContent from './MenuLogoContent.vue';
import MenuCardTip from './MenuCardTip.vue';
import { inject, onMounted, reactive, ref } from 'vue'
import { cropPhoto, openCropper } from '@/service/crop_photo';
import { ElMessage, UploadProps } from 'element-plus';
import { postData, searchGetData, verifyData } from '@/service/login/information';
import {  peopleLoginData } from '@/service/login/people_login';
let dialogFormVisible=ref(false)
let card_open_photo=ref(true)
let card_open=ref('')
let end_crop_photo = ref()
let src_photo = ref('')
let photo_crop= ref(null)
let confirm_photo = ref(false)
const error_form = reactive({
  gender:'',
  phone:'',
})
let close_photo=ref(true)
const formLabelWidth = '140px'
let dialogFormVisibleLogin=ref(false)
const crop_photo_end=()=>{
  end_crop_photo.value = cropPhoto()
  close_photo.value=false
  card_open_photo.value=true
  confirm_photo.value=false
}
const baseURL = inject('baseURL')+'/api/avatar/'
let open_card = ref(null)
let form = reactive({
  file_name:'',
  photo:'',
  username_type:'1',
  username: '',
  gender:'',
  password:'',
  phone:'',
  id:0,
  detailed_address:'',
  address:[]
})
let actiontip = ref(null)
const activeIndex = ref('1')
const handleSelect = (key: string, keyPath: string[]) => {
  activeIndex.value=key
}
const login_add =async ()=>{
  form.photo=end_crop_photo.value
  form.file_name=form.username+form.phone+'.jpg'
  if(confirm_photo.value==true){
    ElMessage({
        type: 'info',
        message: '请先确认裁剪头像',
      })
  }else if(form.gender==''){
    error_form.gender='请选择性别'
  }
  else{
    const res =await verifyData({'phone':form.phone})
    const verify = Object.keys(res).map(Key => res[Key])
    error_form.phone=verify[0]
    if(error_form.phone==undefined){
      form.address=form.address[2]
      form.username_type='1'
      const post_data =await postData(form)
      if(post_data.success=='0'){
        ElMessage({
          type: 'success',
          message: '注册成功！',
        })
        dialogFormVisibleLogin.value=false
      }
      // emit('updateTable')
      // emit('close_dialog')
    }
  }
}
const handleAvatarSuccess: UploadProps['onSuccess'] = (
  response,
  uploadFile
)=> {
  card_open_photo.value=false
  src_photo.value = URL.createObjectURL(uploadFile.raw!)
  setTimeout(()=>{
  openCropper(photo_crop.value,'.photo_card_active')
  confirm_photo.value=true
  console.log(confirm_photo.value);
  },100)
}
const select_card =(res: any)=>{
  card_open.value=res
}
const close_dialog_card=()=>{
  ElMessage({
            type: 'info',
            message: '取消',
          })
  dialogFormVisibleLogin.value=false
}
const open_dialogFormVisible=async(type:string)=>{
  
  if(type=='login'){
    //注册弹出框
    
    dialogFormVisibleLogin.value=true
    const request = await searchGetData().then((res=>{            
          end_crop_photo.value = res
        }))
  }else{
    dialogFormVisible.value=true
    setTimeout(()=>{
      open_card.value.open_card()
    },10)
  }
}
const close_dialogFormVisible=()=>{
  dialogFormVisible.value=false
}
const login_off_new=async(value:any)=>{
  if(value=='0'){
    dialogFormVisibleLogin.value=true
    const request = await searchGetData().then((res=>{            
            end_crop_photo.value = res
    }))
  }else{
    if(value.account==''||value.password==''){
      ElMessage({
            type: 'error',
            message: '账号或密码不能为空！',
          })
    }else{
      //登录
      const res = await peopleLoginData(value)
      if(res.success=='1'){
        ElMessage({
            type: 'error',
            message: '账号或密码错误！',
          })
      }else{
        dialogFormVisible.value=false
        ElMessage({
            type: 'success',
            message: '登录成功！',
          })
          openSessions()
      }
    }
  }
}
const openSessions=async()=>{
  actiontip.value.openSession()
}

</script>
<style src="./Menu.css">

</style>